package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * 林地指标交易平台_补贴申请镇街明细 实体类。
 *
 * @author 11987
 * @since 2025-07-08
 */
@Table(value = "LINDI_SUBSIDY_APPLICATION_TOWN_ITEM", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiSubsidyApplicationTownItem extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 补贴申请镇街明细ID
     */
    private Long subsidyApplicationTownItem;

    /**
     * 补贴申请ID
     */
    private Long subsidyApplicationId;

    /**
     * 镇街名称
     */
    private String townName;

    /**
     * 验收亩数
     */
    private String acceptAcreage;

    /**
     * 总金额
     */
    private String totalAmount;

    // ========== 构造函数 ==========
    
    /**
     * 默认构造函数
     */
    public LindiSubsidyApplicationTownItem() {
        super();
    }

    /**
     * 全参数构造函数
     *
     * @param subsidyApplicationTownItem 补贴申请镇街明细ID
     * @param subsidyApplicationId       补贴申请ID
     * @param townName                   镇街名称
     * @param acceptAcreage              验收亩数
     * @param totalAmount                总金额
     */
    public LindiSubsidyApplicationTownItem(Long subsidyApplicationTownItem, Long subsidyApplicationId, 
                                          String townName, String acceptAcreage, String totalAmount) {
        super();
        this.subsidyApplicationTownItem = subsidyApplicationTownItem;
        this.subsidyApplicationId = subsidyApplicationId;
        this.townName = townName;
        this.acceptAcreage = acceptAcreage;
        this.totalAmount = totalAmount;
    }

    // ========== Getter 和 Setter 方法 ==========
    
    public Long getSubsidyApplicationTownItem() {
        return subsidyApplicationTownItem;
    }

    public void setSubsidyApplicationTownItem(Long subsidyApplicationTownItem) {
        this.subsidyApplicationTownItem = subsidyApplicationTownItem;
    }

    public Long getSubsidyApplicationId() {
        return subsidyApplicationId;
    }

    public void setSubsidyApplicationId(Long subsidyApplicationId) {
        this.subsidyApplicationId = subsidyApplicationId;
    }

    public String getTownName() {
        return townName;
    }

    public void setTownName(String townName) {
        this.townName = townName;
    }

    public String getAcceptAcreage() {
        return acceptAcreage;
    }

    public void setAcceptAcreage(String acceptAcreage) {
        this.acceptAcreage = acceptAcreage;
    }

    public String getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(String totalAmount) {
        this.totalAmount = totalAmount;
    }

    // ========== Object 方法重写 ==========
    
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        
        LindiSubsidyApplicationTownItem that = (LindiSubsidyApplicationTownItem) o;
        
        return Objects.equals(subsidyApplicationTownItem, that.subsidyApplicationTownItem) &&
               Objects.equals(subsidyApplicationId, that.subsidyApplicationId) &&
               Objects.equals(townName, that.townName) &&
               Objects.equals(acceptAcreage, that.acceptAcreage) &&
               Objects.equals(totalAmount, that.totalAmount);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), subsidyApplicationTownItem, subsidyApplicationId, 
                           townName, acceptAcreage, totalAmount);
    }

    @Override
    public String toString() {
        return "LindiSubsidyApplicationTownItem{" +
               "subsidyApplicationTownItem=" + subsidyApplicationTownItem +
               ", subsidyApplicationId=" + subsidyApplicationId +
               ", townName='" + townName + '\'' +
               ", acceptAcreage='" + acceptAcreage + '\'' +
               ", totalAmount='" + totalAmount + '\'' +
               "} " + super.toString();
    }

    // ========== Builder 模式 ==========
    
    public static LindiSubsidyApplicationTownItemBuilder builder() {
        return new LindiSubsidyApplicationTownItemBuilder();
    }

    public static class LindiSubsidyApplicationTownItemBuilder {
        private Long subsidyApplicationTownItem;
        private Long subsidyApplicationId;
        private String townName;
        private String acceptAcreage;
        private String totalAmount;

        LindiSubsidyApplicationTownItemBuilder() {
        }

        public LindiSubsidyApplicationTownItemBuilder subsidyApplicationTownItem(Long subsidyApplicationTownItem) {
            this.subsidyApplicationTownItem = subsidyApplicationTownItem;
            return this;
        }

        public LindiSubsidyApplicationTownItemBuilder subsidyApplicationId(Long subsidyApplicationId) {
            this.subsidyApplicationId = subsidyApplicationId;
            return this;
        }

        public LindiSubsidyApplicationTownItemBuilder townName(String townName) {
            this.townName = townName;
            return this;
        }

        public LindiSubsidyApplicationTownItemBuilder acceptAcreage(String acceptAcreage) {
            this.acceptAcreage = acceptAcreage;
            return this;
        }

        public LindiSubsidyApplicationTownItemBuilder totalAmount(String totalAmount) {
            this.totalAmount = totalAmount;
            return this;
        }

        public LindiSubsidyApplicationTownItem build() {
            return new LindiSubsidyApplicationTownItem(subsidyApplicationTownItem, subsidyApplicationId, 
                                                      townName, acceptAcreage, totalAmount);
        }

        @Override
        public String toString() {
            return "LindiSubsidyApplicationTownItem.LindiSubsidyApplicationTownItemBuilder(" +
                   "subsidyApplicationTownItem=" + subsidyApplicationTownItem +
                   ", subsidyApplicationId=" + subsidyApplicationId +
                   ", townName=" + townName +
                   ", acceptAcreage=" + acceptAcreage +
                   ", totalAmount=" + totalAmount + ")";
        }
    }

}
